<template>
  <div>
    {{ value }}
  </div>
</template>

<script>
export default {
  props: {
    parentCode: {
      type: String,
      default: ''
    },
    code: {
      type: String,
      default: ''
    }
  },
  data () {
    return {
      value: '-'
    }
  },
  mounted () {
    this.search()
  },
  watch: {
    parentCode () {
      this.search()
    },
    code () {
      this.search()
    }
  },
  methods: {
    search () {
      this.$http.get('/zg-system/dic/info', {
        parentCode: this.parentCode,
        code: this.code
      }, data => {
        this.value = data
      })
    }
  }
}
</script>
<style lang="less" scoped>
</style>
